#ifndef DATACONVERSION_H
#define DATACONVERSION_H

#include <stdint.h>


#define F_HEAD  0xFF  // frame head


uint16_t bsToU16(const uint8_t buf[], uint16_t offset);
float bsToU16D1(const uint8_t buf[], uint16_t offset);
int16_t bsToS16(const uint8_t buf[], uint16_t offset);
float bsToS16D1(const uint8_t buf[], uint16_t offset);

void U16ToBs(uint8_t buf[], uint16_t value);
void U16D1ToBs(uint8_t buf[], float value);
void S16ToBs(uint8_t buf[], int16_t value);
void S16D1ToBs(uint8_t buf[], float value);

#endif  // DATACONVERSION_H
